import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './main.css'
import App from './App'

// 如果是在开发环境，并且想在生产环境才启用 PWA，可以添加环境判断
// if (import.meta.env.PROD) {
  // 注册 Service Worker
  navigator.serviceWorker.register('/sw.js').then((registration) => {
    console.log('SW registered: ', registration)
  }).catch((registrationError) => {
    console.log('SW registration failed: ', registrationError)
  })
// }

createRoot(document.getElementById('root')).render(
  <StrictMode>
    <App />
  </StrictMode>,
)